Methods to avoid the SQL divide by zero error